local menghua = fk.CreateSkill{
    name = "XD__menghua",
    tags = {Skill.Limited},
}
Fk:loadTranslationTable{
    ["XD__menghua"] = "梦华",
    [":XD__menghua"] = "限定技，出牌阶段，你可以将弃牌堆中的任意张装备牌置于你的装备区，然后你的手牌上限-1。",
}

menghua:addEffect("active",{
    card_num = 0,
    card_filter = Util.FalseFunc,
    target_num = 0,
    target_filter = Util.FalseFunc,
    can_use = function (self, player)
        return player:usedSkillTimes(menghua.name, Player.HistoryGame) == 0
    end,
    on_use = function (self, room, effect)
        local player = effect.from
        while true do
            local cards = table.filter(room.discard_pile, function (cardID)
                return Fk:getCardById(cardID).type == Card.TypeEquip
            end)
            local use = room:askToUseRealCard(player, {
                pattern = tostring(Exppattern{ id = cards }),
                expand_pile = cards,
                skill_name = menghua.name,
            })
            if not use then
                break
            end
        end
        room:addPlayerMark(player, MarkEnum.MinusMaxCards, 1)
    end,
})

return menghua